


file_list = [
    '../node_modules/@polkadot/api-derive/staking/stashes.js',
    '../node_modules/@polkadot/types/create/createType.js',
    '../node_modules/@polkadot/api/base/capabilities.js',
    '../node_modules/@polkadot/types/codec/utils/decodeU8a.js',
    '../node_modules/@polkadot/api-derive/type/util.js',
]

for item in file_list:
    file = open(item,'r', encoding='utf8',errors='ignore')
    file_contain = file.read()
    file.close()

    file_contain = file_contain.replace('} catch {', '} catch (_) {')
    file = open(item, 'w')
    file.write(file_contain)
    file.close()